<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>订单打印</title>
    <script type="text/javascript">
        function doPrint() {
            bdhtml=window.document.body.innerHTML;
            sprnstr="<!--startprint-->";
            eprnstr="<!--endprint-->";
            prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17);
          //  prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));
            window.document.body.innerHTML=prnhtml;
            window.print();
        }
    </script>
    <style type="text/css" media="all">
        .print_container{
            width: 5.8cm;
            height: 21cm;
            margin: 0cm;
        }
    </style>
    <style type="text/css" media="print">
        @page  {
            width: 5cm;
            height: 21cm;
            margin: 0.1cm;
            padding: 0cm;
        }
        .print_container{
            width: 5cm;
            height: auto;
            text-align: left;
        }
    </style>
</head>

<body>
<!-- <p>1不需要打印的地方</p>
<p>2这里不要打印啊</p>  -->
<button type="button" onclick="doPrint()" style="position: fixed;right: 20%;padding: 5px 10px;border: 1px solid #1E9FFF;background: #1E9FFF;color: white;top: 50%;">打印</button>
<!--注意要加上html里star和end的这两个标记-->
<!--startprint-->
<div class="print_container">
    <!--<h1>给顾客专用</h1>-->
    <!--<span>**************************</span>-->
    <div class="section1">
        <h5>{$order.store}</h5>
    </div>
    <span>**************************</span>
    <div class="section2">
        <label>订单编号：{$order.sn}</label>
    </div>
    <span>**************************</span>
    <div class="section3">
        <label>下单时间：{$order.create_time}</label>
    </div>
    <span>**************************</span>
    <div class="section4">
        {if condition="isset($order.goods)"}
        <div style="border-bottom: 1px solid #DADADA;">
            <table style="width: 100%;">
                <thead>
                <tr>
                    <td width="40%">名称</td>
                    <td width="30%">数量</td>
                    <td width="30%">金额</td>
                </tr>
                </thead>
                <tbody>
                {volist name="order.goods" id="v"}
                <tr>
                    <td>{$v.goods_name}</td>
                    <td>{$v.goods_num}</td>
                    <td>{$v.goods_price}</td>
                </tr>

                {/volist}

                </tbody>
            </table>
        </div>
        {/if}
        <div class="other_fee">
            <div class="canh">
                <label class="left">订单备注:</label>
                <label class="right">{$order.remark}</label>
                <div class="clearfix"></div>
            </div>
            <!--<div class="peis">-->
            <!--<label class="left">配送费</label>-->
            <!--<label class="right">0</label>-->
            <!--<div class="clearfix"></div>-->
            <!--</div>-->
            <div class="manj">
                <label class="left">优惠:</label>
                <label class="right">￥ {$order.youhui}</label>
                <div class="clearfix"></div>
            </div>
        </div>
        <div class="total">
            <label class="left">总计:</label>
            <label class="right">￥ {$order.price}</label>
            <div class="clearfix"></div>
        </div>
        <!--<div style="text-align: right;">-->
            <!--<label>顾客已付款</label>-->
        <!--</div>-->
        <span>**************************</span>
    </div>
    <div class="section5">
        <label>姓名：{$order.user_name}</label>
    </div>
    <div class="section5">
        <label>电话：{$order.user_phone}</label>
    </div>
    <div class="section5">
        <label>桌号：{$order.table}</label>
    </div>
    <span>**************************</span>
</div>
</div>
<!--endprint-->

<!-- <p>不打印的地方啊哈哈哈哈</p>
<p>2</p>  -->
</body>
</html>